﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

namespace com.yd.sdk.api
{
    public interface IPayListener
    {
        /// <summary>
        /// 断开IAP连接事件
        /// </summary>
        event UnityAction HandleIAPServerDisconnected;
        
        /// <summary>
        /// 初始化IAP成功 (包含,连接服务器,拉取SKU,验证缓存交易)
        /// </summary>
        event UnityAction HandleIAPSetUpSuccess;
        
        /// <summary>
        /// 初始化IAP失败 (包含,连接服务器,拉取SKU,验证缓存交易)
        /// </summary>
        event UnityAction<string> HandleIAPSetUpFailed;
        
        /// <summary>
        /// 购买成功
        /// </summary>
        event UnityAction<string> HandleIAPPurchaseSuccess;
        
        /// <summary>
        /// 购买失败
        /// </summary>
        event UnityAction<string,string> HandleIAPPurchaseFailed;

        /// <summary>
        /// 历史查询成功
        /// </summary>
        event UnityAction<string> HandleQueryPurchaseHistorySucess;
        
        /// <summary>
        /// 历史查询失败
        /// </summary>
        event UnityAction<string> HandleQueryPurchaseHistoryFailed;
        
        
        void OnIAPServerDisconnected();

        void OnIAPSetUpSuccess();

        void OnIAPSetUpFailed(string message);

        void OnIAPPurchaseSuccess(string message);

        void OnIAPPurchaseFailed(string name,string message);
        
        void OnQueryPurchaseHistorySucess(string skus);

        void OnQueryPurchaseHistoryFailed(string message);
        
    }

}
